cmake_minimum_required(VERSION 3.15)

project(TerminalDriverProject LANGUAGES C CXX ASM)

find_bsp(ID com.sysprogs.project_importers.stm32.cubemx SOURCE_PROJECT TerminalDriverProject.ioc)

bsp_include_directories(DeviceDriverLib/W5500)
add_bsp_based_executable(
	NAME TerminalDriverProject
	GENERATE_BIN
	GENERATE_MAP
	SOURCES
		${BSP_ROOT}/App/protocol.h
		${BSP_ROOT}/App/StartDefaultTask.c
		${BSP_ROOT}/App/Includes.h
		${BSP_ROOT}/DriverLib/SPI_Driver.c
		${BSP_ROOT}/DriverLib/UartDriver.c
		${BSP_ROOT}/DriverLib/SPI_Driver.h
		${BSP_ROOT}/DriverLib/UartDriver.h
		${BSP_ROOT}/DeviceDriverLib/eeprom.c
		${BSP_ROOT}/DeviceDriverLib/MT6701_Driver.c
		${BSP_ROOT}/DeviceDriverLib/eeprom.h
		${BSP_ROOT}/DeviceDriverLib/MT6701_Driver.h
		${BSP_ROOT}/DeviceDriverLib/W5500/socket.c
		${BSP_ROOT}/DeviceDriverLib/W5500/utility.c
		${BSP_ROOT}/DeviceDriverLib/W5500/W5500_Driver.c
		${BSP_ROOT}/DeviceDriverLib/W5500/socket.h
		${BSP_ROOT}/DeviceDriverLib/W5500/types.h
		${BSP_ROOT}/DeviceDriverLib/W5500/utility.h
		${BSP_ROOT}/DeviceDriverLib/W5500/W5500_Driver.h
		${BSP_ROOT}/DeviceDriverLib/Internet/dhcp.c
		${BSP_ROOT}/DeviceDriverLib/Internet/http_server.c
		${BSP_ROOT}/DeviceDriverLib/Internet/httputil.c
		${BSP_ROOT}/DeviceDriverLib/Internet/netbios.c
		${BSP_ROOT}/DeviceDriverLib/Internet/udp.c
		${BSP_ROOT}/DeviceDriverLib/Internet/dhcp.h
		${BSP_ROOT}/DeviceDriverLib/Internet/http_server.h
		${BSP_ROOT}/DeviceDriverLib/Internet/httputil.h
		${BSP_ROOT}/DeviceDriverLib/Internet/netbios.h
		${BSP_ROOT}/DeviceDriverLib/Internet/udp.h
		${BSP_ROOT}/DeviceDriverLib/Internet/webpge.h
		${BSP_ROOT}/App/UartComTask.c
		${BSP_ROOT}/App/UDP_CommTask.c)

target_include_directories(TerminalDriverProject PRIVATE App DeviceDriverLib DeviceDriverLib/W5500 DriverLib App DeviceDriverLib DeviceDriverLib/W5500 DriverLib DeviceDriverLib/Internet App DeviceDriverLib DeviceDriverLib/Internet DeviceDriverLib/W5500 DriverLib DeviceDriverLib/W5500 DeviceDriverLib/W5500 DriverLib)
